package cn.edu.sjtu.se.dslab.rhapsody.parse;

import java.util.HashMap;
import java.util.Map;

import org.dom4j.Namespace;
import org.dom4j.QName;


public final class XmiConst {
	public static final Namespace XMI_NS = new Namespace("xmi", "http://schema.omg.org/spec/XMI/2.1");
	public static final Namespace UML_NS = new Namespace("uml", "http://www.omg.org/spec/UML/20090901");
	public static final Namespace ECORE_NS = new Namespace("ecore","http://www.eclipse.org/emf/2002/Ecore");
	public static final Namespace XSI_NS = new Namespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
//	public static final Namespace XMLNS = new Namespace("xmlns", "");
	
	//public static final Namespace AVIONICS_PROFILE_NS = new Namespace("Avionics_profile", 
	//		"http://MethodologyDemo.Avionics/schemas/Avionics_profile/_rBeSIFjOEeO1mcxiBa0U2A/0");
//	public static final Namespace ARCHITECTURE_NS = new Namespace("Architecture",
//			"http://Phase4.Avionics/schemas/Architecture/_PW0c8Gt6EeOk7pqVCJyUWw/0");
	//public static final Namespace ARCHITECTURE_NS = new Namespace("Architecture",
	//		"http://Phase4.Avionics/schemas/Architecture/_hk5dBXapEeO2zcNjgWu0yA/0");
	public static Namespace ARCHITECTURE_NS;
	public static Namespace FUNCTIONAL_NS;

//	public static final Namespace FUNCTIONAL_NS = new Namespace("Functional",
//			"http://Phase4.Avionics/schemas/Functional/_PW2SIGt6EeOk7pqVCJyUWw/0");
//	public static final Namespace FUNCTIONAL_NS = new Namespace("Functional",
//			"http://Phase4.Avionics/schemas/Functional/_hk5dBnapEeO2zcNjgWu0yA/0");

	
	
	public static final String XSI_SCHEMALOCATION = "";
//	public static final String XSI_SCHEMALOCATION = "http://Phase4.Avionics/schemas/Architecture/_PW0c8Gt6EeOk7pqVCJyUWw/0 "
//				+ "#_QGZgBmt6EeOk7pqVCJyUWw http://Phase4.RHPSysML/schemas/Blocks/_PWxZoGt6EeOk7pqVCJyUWw/0 " 
//				+ "#_QGYSFWt6EeOk7pqVCJyUWw http://Phase4.Avionics/schemas/Functional/_PW2SIGt6EeOk7pqVCJyUWw/0 #_QGZgXmt6EeOk7pqVCJyUWw "
//				+ "http://Phase4/schemas/HarmonySE/_PWzO0Wt6EeOk7pqVCJyUWw/0 HarmonySE.sbs.xmi#_QGSyEmt6EeOk7pqVCJyUWw "
//				+ "http://RhapsodyStandardModel.PredefinedTypes/schemas/PredefinedTypes_profile/_PXADIGt6EeOk7pqVCJyUWw/0 #_QGjQxGt6EeOk7pqVCJyUWw "
//				+ "http://www.omg.org/spec/UML/20090901/StandardProfileL2.xmi http://www.omg.org/spec/UML/20090901/StandardProfileL2.xmi#_yzU58YinEdqtvbnfB2L_5w http://www.omg.org/spec/SysML/20120401/SysML #_68xpIWbXEeKKCp6QknzCFw http://www.omg.org/spec/UML/20090901 http://www.eclipse.org/uml2/2.0.0/UML";
	
	// the label name start with L
	public static final QName L_XMI_XMI = new QName("XMI", XMI_NS); // the root of the xmi
														// file
	public static final QName L_UML_MODEL = new QName("Model", UML_NS);
	public static final QName L_UML_PROFILE = new QName("Profile", UML_NS);
	public static final String L_PACKAGED_ELEMENT = "packagedElement";
	
	//public static final QName L_AVIONICS_PROFILE_EXTERNALSYSTEM = new QName("ExternalSystem", AVIONICS_PROFILE_NS);
//	public static final QName L_ARCHITECTURE_OUTERSYSTEM = new QName("OuterSystem", ARCHITECTURE_NS);
//	public static final QName L_FUNCTIONAL_DATAZONE = new QName("DataZone", FUNCTIONAL_NS);
//	public static final QName L_FUNCTIONAL_EVENTRESPONSER = new QName("EventResponser", FUNCTIONAL_NS);
//	public static final QName L_FUNCTIONAL_BUSINTERACTIONAGENT = new QName("BusInteractionAgent", FUNCTIONAL_NS);
//	public static final QName L_FUNCTIONAL_INFORMATIONDISPLAYAGENT = new QName("InformationDisplayAgent", FUNCTIONAL_NS);
	
	//运行时才初始化
	public static QName L_ARCHITECTURE_OUTERSYSTEM ;
	public static QName L_FUNCTIONAL_DATAZONE ;
	public static QName L_FUNCTIONAL_EVENTRESPONSER;
	public static QName L_FUNCTIONAL_BUSINTERACTIONAGENT;
	public static QName L_FUNCTIONAL_INFORMATIONDISPLAYAGENT;
	public static QName L_FUNCTIONAL_DOMAINENTITY ;
	
	public static final String L_OWNEDATTRIBUTE = "ownedAttribute";
	
	// the attribute name start with A
	public static final String A_NAME = "name";
	public static final QName A_XMI_TYPE = new QName("type", XMI_NS);
	public static final String A_HREF = "href";
	public static final QName A_XMI_ID = new QName("id", XMI_NS);
	public static final QName A_XMI_VERSION = new QName("version", XMI_NS);
	public static final String A_VISIBILITY = "visibility";
	public static final String A_AGGREGATION = "aggregation";
	public static final String A_TYPE = "type";
	
	
//	public static final QName A_XMLNS_XMI = new QName("xml", XMLNS);
//	public static final QName A_XMLNS_XSI = new QName("xsi", XMLNS);
//	public static final QName A_XMLNS_ECORE = new QName("ecore", XMLNS);
//	public static final QName A_XMLNS_UML = new QName("uml", XMLNS);
	public static final QName A_XSI_SCHEMALOCATION = new QName("schemaLocation", XSI_NS);
	
	public static final String A_BUS_TYPE = "bus_type";
	public static final String A_BASE_CLASS = "base_Class";
	public static final String A_BASE_ACTOR = "base_Actor";
	
	//functional datazone
	public static final String A_SIZE = "size";
	public static final String A_URI = "URI";
	public static final String A_BASE_PROPERTY="base_Property";
	public static final String A_ENTITYURI = "entityURI";
	public static final String A_ZONE_TYPE = "zone_type";
	//functional domainEntity
	public static final String A_ENTITY_TYPE = "entity_type";
	public static final String A_BASE_DATATYPE = "base_DataType";
	
	//functional event responser
	public static final String A_EVENTURI = "eventURI";
	public static final String A_PAGEURI = "pageURI";
	public static final String A_BASE_OPERATION = "base_Operation";
	public static final String A_CLASS = "class";
	//functional bus interfaction agent
	public static final String A_FREQUENCY = "frequency";
	public static final String A_DATAZONES = "dataZones";
	public static final String A_OUTERSYSTEMURI = "outerSystemURI";
	
	//values of the DATA_ZONE profile
	public static final String ZONE_TYPE_DISPLAY = "display";
	public static final String ZONE_TYPE_DATA_ENTITY = "data_entity";
	public static final String ZONE_TYPE_BUS = "bus";
	//functional information display agent
	
	
	// the xmi type start with T
	public static final QName T_UML_ELEMENT = new QName("ElementImport", UML_NS);
	public static final QName T_UML_PROFILE = new QName("Profile", UML_NS);
	public static final QName T_UML_PACKAGE = new QName("Package", UML_NS);
	public static final QName T_UML_CLASS = new QName("Class", UML_NS);
	public static final QName T_UML_ACTOR = new QName("Actor", UML_NS);
	public static final QName T_UML_PRIMITIVETYPE = new QName("PrimitiveType", UML_NS);
	public static final QName T_UML_PROPERTY = new QName("Property", UML_NS);
	public static final QName T_UML_OPERATION = new QName("Operation", UML_NS);

	public static final Map<String, QName> UML_TYPE_SET = new HashMap<String,QName>();

	static {
		UML_TYPE_SET.put(T_UML_PRIMITIVETYPE.getQualifiedName(), T_UML_PRIMITIVETYPE);
		UML_TYPE_SET.put(T_UML_PACKAGE.getQualifiedName(), T_UML_PRIMITIVETYPE);
//		UML_TYPE_SET.put(T_UML_PRIMITIVETYPE.getQualifiedName(), T_UML_PRIMITIVETYPE);
//		UML_TYPE_SET.put(T_UML_PRIMITIVETYPE.getQualifiedName(), T_UML_PRIMITIVETYPE);
	}

}
